package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo8 {
    public static void main(String[] args) throws Exception{
        Class<?> cls = Class.forName("reflect.Person");

        Method method = cls.getDeclaredMethod("sayHello");

        if ( method.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod annotation = method.getAnnotation(AutoRunMethod.class);
            int i = annotation.value();
            System.out.println("注释的参数为" + i);
        }


    }
}
